package com.vr.caricature.fenlei;

import android.content.Context;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.vr.caricature.R;

import java.util.zip.Inflater;

/**
 * Created by chengxiaozhi on 2016/11/3.
 */

public class VideoAdapter extends BaseAdapter {

    private LayoutInflater mInflater;

    public VideoAdapter(Context context){
        mInflater = LayoutInflater.from(context);
    }


    @Override
    public int getCount() {
        return 6;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder = null;
        if(convertView==null){
            convertView = mInflater.inflate(R.layout.item_video,null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        }else{
            holder = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }


    private static class ViewHolder{

        private TextView tvDescription;
        private ImageView ivDes;

        public ViewHolder(View view){
            tvDescription = (TextView) view.findViewById(R.id.tv_description);
            ivDes = (ImageView) view.findViewById(R.id.iv_des);
        }
    }
}
